<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<script>
	function operationToResult(){
		var operator = document.getElementById("operator").value;
		var num1 = parseInt(document.getElementById("num1").value);
		var num2 = parseInt(document.getElementById("num2").value);
		var result;
		if(operator=="+") result=num1+num2;
		else if(operator=="-") result=num1-num2;
		else if(operator=="*") result=num1*num2;
		else if(operator=="/") result=num1/num2;
		else if(operator=="%") result=num1%num2;
		
		document.getElementById("result").value=parseInt(result);
	}	
</script>
<form action="edu01.op" method="post">
<input type="text" name="num1" id="num1">
<select name="operator" id="operator">
	<option value="+">+</option>
	<option value="-">-</option>
	<option value="*">*</option>
	<option value="/">/</option>
	<option value="%">%</option>
</select>

<input type="text" name="num2" id="num2">=
<input type="text" name="result" id="result"><p>
<input type="submit" value="계산"> 
</form>
</body>
</html>